<?php
    
    class Views{
        
        private static $key;
        
        public static $error = array(
            "404"     =>      "Error/404.php"
        );
        
        public static $pages = array(
            "main"     =>      "main.php"
            
            ,"fart"     =>      "Controller/FART.php"
            ,"log"     =>      "find.log"
        );
        
        /**
         * Shows the page requested.
         * @param type $key 
         */
        public static function show($key){
            self::$key = $key;
            include self::getPage();
        }
        
        /**
         * Retrieves pagename either in the error or pages.
         * @return string
         */
        public static function getPage(){
            try {
                $key = self::$key;
                $isListed = isset(self::$pages[$key]) ? true : false;

                if($isListed){
                    return self::$pages[$key];
                }
            } catch (Exception $exc) {
                
            }
            
            return self::$error["404"];
        }
    }
?>
